//
//  CGSize+Global.swift
//  DF_Student
//
//  Created by 刘盖 on 2023/12/9.
//  Copyright © 2023 DFJGED. All rights reserved.
//

import UIKit

public extension CGSize {
    
    static func size_string(_ str: NSString?, attr: [NSAttributedString.Key : Any]?, size: CGSize) -> CGSize {
        guard let str = str else {
            return .zero
        }
        return str.boundingRect(with: size, options: .usesLineFragmentOrigin, attributes: attr, context: nil).size
    }
}
